package com.ctsi.security.event.organ;

import com.ctsi.commons.event.AbstractObserver;
import com.ctsi.framework.common.startrun.ComponentFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;



public class OrganLeaveUserGroupEvent extends AbstractObserver {
	/**
	 * serialVersionUID
	 */
	private static final long serialVersionUID = 5218428372160881725L;
	private static Logger logger = LoggerFactory.getLogger(OrganLeaveUserGroupEvent.class);
	private static OrganEventService organEventService;

	@Override
	public void onEvent(Object[] args) {
		logger.info("权限组织事件处理：组织结构组织离开用户组");
      if(args.length>1){
    	  String organId=(String) args[1];
    	  String groupId=(String) args[2];
    	  organEventService=this.getOrganEventService();
    	  organEventService.organLeaveUserGroupEvent(groupId, organId);
      }		
      
	}
	private OrganEventService getOrganEventService(){
		if(organEventService==null){
			organEventService=(OrganEventService) ComponentFactory.getApplicationContext().getBean("organEventService");
		}
		return organEventService;
	}

}
